namespace CShipBasic.PropertyAndIndex;

public abstract class Person1
{
    // 抽象属性定义
    public abstract string Name{
        get;
        set;
    }
    public abstract int Age{
        get;
        set;
    }
}

class Student2 : Person1{

    private string code = "N.A";
    private string name = "N.A";
    private int age = 0;

    // 声明类型为 string 的 Code 属性
    public string Code{
        get{
            return code;
        }
        set{
            code = value;
        }
    }
   
    // 声明类型为 string 的 Name 属性
    public override string Name{
        get{
            return name;
        }
        set{
            name = value;
        }
    }

    // 声明类型为 int 的 Age 属性
    public override int Age{
        get{
            return age;
        }
        set{
            age = value;
        }
    }
    public override string ToString(){
        return "Code = " + Code +", Name = " + Name + ", Age = " + Age;
    }
}